﻿#ifndef SEARCHHOTELHEADER_H
#define SEARCHHOTELHEADER_H

#include <QWidget>
#include "globalvars.h"

namespace Ui {
class SearchHotelHeader;
}

class SearchHotelHeader : public QWidget
{
    Q_OBJECT
signals:
    void signalGainHotelInfoList(QString msg);
public:
    explicit SearchHotelHeader(QWidget *parent = nullptr);
    ~SearchHotelHeader();

    void setCount(int count);
    void constructeCondition(int type, bool checked, const QString &str);
    void constructeMarkCondition(bool checked, const QString& mark, const QString &text);
    void constructePriceCondition(bool checked, const QString& price);
    QString getInTime();
    QString getOutTime();

private slots:
    void on_pb_typeNoCondition_clicked();
    void on_pb_priceNoCondition_clicked();
    void on_pb_markNoCondition_clicked();
    void on_pb_starNoCondition_clicked();

    void on_cb_economyHotel_clicked(bool checked);
    void on_cb_themeHotel_clicked(bool checked);
    void on_cb_hostel_clicked(bool checked);
    void on_cb_resortHotel_clicked(bool checked);
    void on_cb_villa_clicked(bool checked);

    void on_cb_country_clicked(bool checked);
    void on_cb_inn_clicked(bool checked);
    void on_cb_luxuryHotel_clicked(bool checked);
    void on_cb_apartment_clicked(bool checked);
    void on_cb_businessHotel_clicked(bool checked);

    void on_cb_below100_clicked(bool checked);
    void on_cb_100_200_clicked(bool checked);
    void on_cb_200_300_clicked(bool checked);
    void on_cb_300_400_clicked(bool checked);
    void on_cb_400_500_clicked(bool checked);
    void on_cb_greater500_clicked(bool checked);
    void on_le_lowPrice_editingFinished();
    void on_le_highPrice_editingFinished();
    void on_le_lowPrice_textChanged(const QString &arg1);
    void on_le_highPrice_textChanged(const QString &arg1);

    void on_cb_greaterFive_clicked(bool checked);
    void on_cb_greaterFourEight_clicked(bool checked);
    void on_cb_greaterFourFive_clicked(bool checked);
    void on_cb_greaterFourTwo_clicked(bool checked);
    void on_cb_greaterFour_clicked(bool checked);
    void on_cb_lesserFour_clicked(bool checked);

    void on_cb_oneStar_clicked(bool checked);
    void on_cb_twoStar_clicked(bool checked);
    void on_cb_threeStar_clicked(bool checked);
    void on_cb_fourStar_clicked(bool checked);
    void on_cb_fiveStar_clicked(bool checked);

    void on_le_city_editingFinished();
    void on_le_city_textChanged(const QString &arg1);
    void on_le_condition_textChanged(const QString &arg1);
    void on_le_condition_editingFinished();
    void on_de_inTime_userDateChanged(const QDate &date);
    void on_de_outTime_userDateChanged(const QDate &date);

    void on_pb_search_clicked();

private:
    Ui::SearchHotelHeader *ui;
    QString m_hotelMark;
    QString m_hotelPrice;
    QStringList m_hotelTypeList;
    QStringList m_hotelStarList;

    QString m_inTime;
    QString m_outTime;
    QString m_city;
    QString m_locationOrName;
};

#endif // SEARCHHOTELHEADER_H
